package model;

import java.util.StringTokenizer;

public class Sentence {
	public static String[] labels = { "UNKNOWN", "NEUTRAL", "NEGATIVE",
			"MIXED", "POSITIVE" };// By default the label is
	// unjudged
	public static final int UNKNOWN = 0;
	public static final int IRRELEVANT = 0;
	public static final int RELEVANT = 1;
	public static final int NEUTRAL = 1;
	public static final int NEGATIVE = 2;
	public static final int MIXED = 3;
	public static final int POSITIVE = 4;
	private int sentimentPolarity = UNKNOWN;
	private int topicality = UNKNOWN;
	private String content;

	public Sentence(String content, int sentimentPolarity, int topicality) {
		this.content = content;
		this.sentimentPolarity = sentimentPolarity;
		this.topicality = topicality;
	}

	public Sentence(String text) {
		content = text;
		this.sentimentPolarity = Sentence.UNKNOWN;
		this.topicality = Sentence.UNKNOWN;
	}

	public String getContent() {
		return content;
	}

	public void setTopicality(int topicality) {
		this.topicality = topicality;
	}

	public int getTopicality() {
		return topicality;
	}

	public void setSentimentPolarity(int sentimentPolarity) {
		this.sentimentPolarity = sentimentPolarity;
	}

	public int getSentimentPolarity() {
		return sentimentPolarity;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getNumOfTokens() {
		StringTokenizer stk = new StringTokenizer(content, " ");
		return stk.countTokens();
	}

	public String toAnnotation() {
		String sentence = "";
		sentence = sentence.concat(content + "|" + sentimentPolarity + "|"
				+ topicality);
		return sentence;
	}
}
